import request from '@/config/axios'

export interface OutboundDeliveryGoodsDetailVO {
  id: number
  orderNumber: string
  supplierName: string
  salesName: string
  requisitionForm: string
  dictOutsourceMode: number
  productNumber: string
  partNumber: string
  partName: string
  drawingNumber: string
  partSpecification: string
  material: string
  specification: string
  netSizeLength: number
  netSizeWidth: number
  cuttingSizeLength: number
  cuttingSizeWidth: number
  purchaseQuantity: number
  partUnit: string
  dictProcessName: number
  dictTypeOfWork: number
  dictBaitingType: number
  dictIsMachine: number
  dictMachiningProcess: number
  requirementTime: localdate
  pid: number
  arriveQuantity: number
  quantityCollected: number
  qualifiedInspectionNumber: number
  failuresInspectionNumber: number
  dictQualityGate: number
  creatorName: string
  updaterName: string
}

// 查询外协到货单详情列表
export const getOutboundDeliveryGoodsDetailPage = async (params) => {
  return await request.get({ url: `/outsource/outbound-delivery-goods/quote/arrive_goods`, params })
}

// 查询外协到货单详情详情
export const getOutboundDeliveryGoodsDetail = async (id: number) => {
  return await request.get({ url: `/outsource/outbound-delivery-goods-detail/get?id=` + id })
}

// 新增外协到货单详情
export const createOutboundDeliveryGoodsDetail = async (data) => {
  return await request.post({ url: `/outsource/outbound-delivery-goods-detail/create`, data })
}

// 修改外协到货单详情
export const updateOutboundDeliveryGoodsDetail = async (data: OutboundDeliveryGoodsDetailVO) => {
  return await request.put({ url: `/outsource/outbound-delivery-goods-detail/update`, data })
}

// 删除外协到货单详情
export const deleteOutboundDeliveryGoodsDetail = async (id: number) => {
  return await request.delete({ url: `/outsource/outbound-delivery-goods-detail/delete?id=` + id })
}

// 导出外协到货单详情 Excel
export const exportOutboundDeliveryGoodsDetail = async (params) => {
  return await request.download({ url: `/outsource/outbound-delivery-goods/export-excel`, params })
}
